package com.alibaba.citrus.cr.b2b.trade.order.functions.deliveryOrderDetail.entity;

import com.alibaba.citrus.cr.b2b.trade.order.repository.DeliveryOrderDetailRepository;
import com.alibaba.citrus.cr.common.util.SpringContextUtil;
import com.epoch.app.crb2btradecenter.sdo.DeliveryOrderDetailSDO;
import lombok.Getter;

@Getter
public class DeliveryOrderDetailEntity {

    private DeliveryOrderDetailSDO deliveryOrderDetailSDO;

    private static DeliveryOrderDetailRepository deliveryOrderDetailRepository;

    static {
        deliveryOrderDetailRepository = SpringContextUtil.getBean(DeliveryOrderDetailRepository.class);
    }

    public static DeliveryOrderDetailEntity of(DeliveryOrderDetailSDO deliveryOrderDetailSDO){
        DeliveryOrderDetailEntity deliveryOrderDetailEntity = new DeliveryOrderDetailEntity();
        deliveryOrderDetailEntity.deliveryOrderDetailSDO = deliveryOrderDetailSDO;
        return deliveryOrderDetailEntity;
    }

    /**
     * 修改交互子单状态
     */
    public Boolean modify() {
        return deliveryOrderDetailRepository.modify(this.deliveryOrderDetailSDO);
    }
}
